package com.yt.user.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.yt.user.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yt.user.mapper.UserAddressMapper;
import com.yt.user.models.service.IUserAddressService;
import com.yt.user.models.bo.UserAddressSaveBO;
import com.yt.user.models.dto.UserAddressDTO;

/**
 * 用户地址控制器
 *
 * @author lvzeming
 * @Date 2025-08-22 21:17:59
 */
@DubboService
public class UserAddressServiceImpl extends ServiceImpl<UserAddressMapper, UserAddressDTO> implements IUserAddressService{

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(UserAddressSaveBO saveBO) {
        UserAddressDTO dto = new UserAddressDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
}
